<template>
	<view class="cs-video-ul">
		<view class="cs-video-ul-li" v-for="(item,index) in video_list" :key='index' 
		@click="linkVideoDetail(index)"
		:style="item.img_url.length > 0 ? 'background: url('+ item.img_url  + ')no-repeat' : 'background: url(/static/defaultImgUrl.png)no-repeat'">
			<view class="cs-video-ul-li-label">
				<view class="label-tc">
					<!-- 晒一晒家乡的美景，我的家乡最美丽~ -->
					{{item.title}}
				</view>
				<view class="label-tx">
					<view class="label-tx-img">
						<image class="img" :src="item.avatar || '/static/image/logo.png'" mode="aspectFill"></image>
					</view>
					<view class="label-tx-zan" @click.stop='videoLike(index)'>
						<text :class="['iconfont1 iconzan icon_zan', (item.is_like == null || item.is_like) == 1 ? '' : 'zan-active']"></text>{{item.likenum}}
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		props: {
			video_list: Array,
		},
		data() {
			return {
			}
		},
		methods: {
			// 喜欢/不喜欢
			videoLike(index) {
				this.$emit('videoLike', index)
			},
			
			// 视频详情
			linkVideoDetail(index) {
				this.$emit('linkVideoDetail',index)
			}
		}
	}
</script>

<style lang="scss" scoped>
	.cs-video-ul{
		display: flex;
		justify-content: space-between;
		flex-wrap: wrap;
		margin-top: 216upx;
		padding: 0 28upx;
		padding-top: 20upx;
		border-top: 20upx solid #FAFAFA;
	}
	.cs-video-ul-li{
		position: relative;
		height: 458upx;
		width: 342upx;
		margin-bottom: 10upx;
		border-radius: 8upx;
		background-size: 100% 100% !important;
	}
	.cs-video-ul-li-label{
		position: absolute;
		display: flex;
		flex-direction: column;
		justify-content: center;
		bottom: 0;left: 0;right: 0;
		padding: 8upx 30upx;
		border-radius: 8upx;
		background: linear-gradient(#FEFEFE, #B5B5B5)
	}
	.label-tc {
		font-size: 26upx;
		color: #FFFFFF;
	}
	
	// 用户小图片及点赞
	.label-tx{
		display: flex;
		justify-content: space-between;
		align-items: center;
	}
	.label-tx-img {
		width: 50upx;
		height: 50upx;
		& image {
			max-width: 100%;
			max-height: 100%;
			border-radius: 50%;
		}
	}
	.label-tx-zan {
		font-size: 26upx;
		color: #FFFFFF;
	}
	
	// 赞图标
	.icon_zan{
		line-height:0;
		font-size: 48upx;
		vertical-align: middle;
	}
	
	.zan-active{
		color: #FF4E78;
	}
</style>
